﻿<Window x:Class="WaveTech.Scutex.Manager.Windows.FeaturesWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:WaveTech.Scutex.Manager.Controls"
        xmlns:dg="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
        xmlns:Forms="clr-namespace:WaveTech.Scutex.Manager.Forms"
        xmlns:themes="clr-namespace:WPF.Themes;assembly=WPF.Themes"
        x:Name="productFeaturesWindow"
        Title="Product Features"
        Width="450"
        Height="450"
        WindowStartupLocation="CenterOwner">
	<Window.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/DataTemplates.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</Window.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="25" />
			<RowDefinition />
			<RowDefinition />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition />
		</Grid.ColumnDefinitions>

		<StackPanel Grid.Row="0"
		            Grid.Column="0"
		            HorizontalAlignment="Left"
		            VerticalAlignment="Center"
		            Orientation="Horizontal">
			<TextBlock Width="10" />
			<TextBlock Grid.Row="0"
			           Grid.Column="0"
			           HorizontalAlignment="Left"
			           VerticalAlignment="Center"
			           Foreground="Black"
			           Text="Features for Product: " />
			<TextBlock x:Name="lblProductName"
			           Grid.Row="0"
			           Grid.Column="0"
			           HorizontalAlignment="Left"
			           VerticalAlignment="Center"
			           FontWeight="Bold"
			           Foreground="Black"
			           Text="" />
		</StackPanel>

		<GroupBox Grid.Row="1"
		          Grid.Column="0"
		          Margin="4,4,4,4"
		          Foreground="Black"
		          Header="Add New Feature">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="25" />
					<RowDefinition Height="25" />
					<RowDefinition Height="25" />
					<RowDefinition Height="*" />
					<RowDefinition Height="32" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition />
				</Grid.ColumnDefinitions>

				<TextBlock Grid.Row="0"
				           VerticalAlignment="Bottom"
				           Foreground="Black"
				           Text="Feature Name:" />
				<TextBox x:Name="txtFeatureName" Grid.Row="1" />
				<TextBlock Grid.Row="2"
				           VerticalAlignment="Bottom"
				           Foreground="Black"
				           Text="Feature Description:" />
				<TextBox x:Name="txtFeatureDescription" Grid.Row="3" />

				<Button x:Name="btnAddFeature"
				        Grid.Row="4"
				        Margin="4,4,4,4"
				        HorizontalAlignment="Right"
				        Click="btnAddFeature_Click"
				        Content="Add Feature" />
			</Grid>
		</GroupBox>

		<GroupBox Grid.Row="2"
		          Grid.Column="0"
		          Margin="4,4,4,4"
		          Foreground="Black"
		          Header="Features">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="*" />
					<RowDefinition Height="32" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition />
				</Grid.ColumnDefinitions>
				<DataGrid x:Name="gridFeatures"
				          Grid.Row="0"
				          VerticalAlignment="Stretch"
				          AutoGenerateColumns="False"
				          CanUserAddRows="False"
				          CanUserDeleteRows="False"
				          ItemsSource="{Binding SelectedProduct.Features,
				                                ElementName=productFeaturesWindow,
				                                Mode=TwoWay}"
				          SelectionMode="Single">
					<DataGrid.Columns>
						<DataGridTextColumn Width="1*"
						                    Binding="{Binding Path=Name}"
						                    Header="Name"
						                    IsReadOnly="True" />
						<DataGridTextColumn Width="2*"
						                    Binding="{Binding Path=Description}"
						                    Header="Description"
						                    IsReadOnly="True" />
					</DataGrid.Columns>
				</DataGrid>

				<Button x:Name="btnRemoveSelected"
				        Grid.Row="1"
				        Margin="4,4,4,4"
				        HorizontalAlignment="Right"
				        Click="btnRemoveSelected_Click"
				        Content="Remove Selected" />
			</Grid>
		</GroupBox>
	</Grid>
</Window>